.class public Lcom/xingbook/ui/overclass/DrawImageView;
.super Landroid/widget/ImageView;


# instance fields
.field a:Z

.field private b:Landroid/graphics/Bitmap;

.field private c:Landroid/graphics/Canvas;

.field private d:Landroid/graphics/Path;

.field private e:Landroid/graphics/Paint;

.field private f:Landroid/graphics/Paint;

.field private g:Landroid/graphics/MaskFilter;

.field private h:F

.field private i:F


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    invoke-direct {p0, p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1

    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/xingbook/c/e;)V
    .locals 4

    const/4 v3, 0x1

    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    sget v0, Lcom/xingbook/c/e;->c:I

    sget v1, Lcom/xingbook/c/e;->d:I

    sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->b:Landroid/graphics/Bitmap;

    new-instance v0, Landroid/graphics/Canvas;

    iget-object v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->b:Landroid/graphics/Bitmap;

    invoke-direct {v0, v1}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    iput-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->c:Landroid/graphics/Canvas;

    new-instance v0, Landroid/graphics/Path;

    invoke-direct {v0}, Landroid/graphics/Path;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    new-instance v0, Landroid/graphics/Paint;

    const/4 v1, 0x4

    invoke-direct {v0, v1}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->e:Landroid/graphics/Paint;

    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v3}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v3}, Landroid/graphics/Paint;->setDither(Z)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    const/high16 v1, -0x1

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Join;->ROUND:Landroid/graphics/Paint$Join;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeJoin(Landroid/graphics/Paint$Join;)V

    new-instance v0, Landroid/graphics/BlurMaskFilter;

    const/high16 v1, 0x4100

    sget-object v2, Landroid/graphics/BlurMaskFilter$Blur;->NORMAL:Landroid/graphics/BlurMaskFilter$Blur;

    invoke-direct {v0, v1, v2}, Landroid/graphics/BlurMaskFilter;-><init>(FLandroid/graphics/BlurMaskFilter$Blur;)V

    iput-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->g:Landroid/graphics/MaskFilter;

    return-void
.end method


# virtual methods
.method public a()V
    .locals 3

    iget-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    iget v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    iget v2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Path;->lineTo(FF)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->c:Landroid/graphics/Canvas;

    iget-object v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    iget-object v2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Canvas;->drawPath(Landroid/graphics/Path;Landroid/graphics/Paint;)V

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    invoke-virtual {v0}, Landroid/graphics/Path;->reset()V

    return-void
.end method

.method public a(FF)V
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    invoke-virtual {v0}, Landroid/graphics/Path;->reset()V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    invoke-virtual {v0, p1, p2}, Landroid/graphics/Path;->moveTo(FF)V

    iput p1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    iput p2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    return-void
.end method

.method public a(I)V
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V

    return-void
.end method

.method public b()V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->c:Landroid/graphics/Canvas;

    const/4 v1, 0x0

    sget-object v2, Landroid/graphics/PorterDuff$Mode;->CLEAR:Landroid/graphics/PorterDuff$Mode;

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Canvas;->drawColor(ILandroid/graphics/PorterDuff$Mode;)V

    return-void
.end method

.method public b(FF)V
    .locals 6

    const/high16 v2, 0x4080

    const/high16 v5, 0x4000

    iget v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    sub-float v0, p1, v0

    invoke-static {v0}, Ljava/lang/Math;->abs(F)F

    move-result v0

    iget v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    sub-float v1, p2, v1

    invoke-static {v1}, Ljava/lang/Math;->abs(F)F

    move-result v1

    cmpl-float v0, v0, v2

    if-gez v0, :cond_0

    cmpl-float v0, v1, v2

    if-ltz v0, :cond_1

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    iget v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    iget v2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    iget v3, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    add-float/2addr v3, p1

    div-float/2addr v3, v5

    iget v4, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    add-float/2addr v4, p2

    div-float/2addr v4, v5

    invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Path;->quadTo(FFFF)V

    iput p1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    iput p2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    :cond_1
    iget-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    iget v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->h:F

    iget v2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->i:F

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Path;->lineTo(FF)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->c:Landroid/graphics/Canvas;

    iget-object v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    iget-object v2, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Canvas;->drawPath(Landroid/graphics/Path;Landroid/graphics/Paint;)V

    :cond_2
    return-void
.end method

.method public b(I)V
    .locals 3

    const/4 v2, 0x0

    const/high16 v1, 0x41a0

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setMaskFilter(Landroid/graphics/MaskFilter;)Landroid/graphics/MaskFilter;

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v2}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    packed-switch p1, :pswitch_data_0

    :goto_0
    return-void

    :pswitch_0
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    const/high16 v1, 0x4080

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    goto :goto_0

    :pswitch_1
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    const/high16 v1, 0x4100

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    goto :goto_0

    :pswitch_2
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    const/high16 v1, 0x4140

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Cap;->SQUARE:Landroid/graphics/Paint$Cap;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    goto :goto_0

    :pswitch_3
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    iget-object v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->g:Landroid/graphics/MaskFilter;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setMaskFilter(Landroid/graphics/MaskFilter;)Landroid/graphics/MaskFilter;

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Cap;->SQUARE:Landroid/graphics/Paint$Cap;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    goto :goto_0

    :pswitch_4
    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    const/high16 v1, 0x4248

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    goto :goto_0

    :pswitch_5
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Cap;->ROUND:Landroid/graphics/Paint$Cap;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    new-instance v1, Landroid/graphics/PorterDuffXfermode;

    sget-object v2, Landroid/graphics/PorterDuff$Mode;->CLEAR:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {v1, v2}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
    .end packed-switch
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 3

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->b:Landroid/graphics/Bitmap;

    iget-object v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->e:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v2, v2, v1}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    iget-boolean v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->a:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/overclass/DrawImageView;->d:Landroid/graphics/Path;

    iget-object v1, p0, Lcom/xingbook/ui/overclass/DrawImageView;->f:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->drawPath(Landroid/graphics/Path;Landroid/graphics/Paint;)V

    :cond_0
    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 0

    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/ImageView;->onSizeChanged(IIII)V

    return-void
.end method
